home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Certification Exam Guide
/
McGrawwHill-JavaCertificationExamGuide.iso
/
pc
/
Web Links and Code
/
exer
/
chap1
/
exer0118
/
Tree.java
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Java Source
|
1997-04-19
|
318 b
|
18 lines
class Tree {
protected int age;
}
class Pine extends Tree implements Cloneable {
Pine() {
age = 2;
}
}
class Maple extends Tree {
public static void main(String[] args) {
Pine p1 = new Pine();
Pine p2 = p1.clone();
System.out.println("Pine is " + p2.age);
}
}